<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

if ( ! function_exists('table_linker'))
{
    function table_linker($var = '')
    {
        return $var;
		
		//usage:
		//	echo table_linker('x');
    }  
	function workDaysNextDate($date1,$workDays) { 
    $workDays = (int)$workDays;
    if ($workDays <= 0)
        return null;
    $date1=strtotime('-1 day',strtotime($date1));
    $lastYear = null;
    $hol=array(); 
    $i = 0;
    while ($i<=$workDays) { 
        $date1=strtotime('+1 day',$date1);
        $year = date('Y', $date1); 
        if ($year !== $lastYear){ 
            $lastYear = $year; 
            $easter = date('m-d', easter_date($year)); 
            $date = strtotime($year . '-' . $easter); 
            $easterSec = date('m-d', strtotime('+1 day', $date)); 
            $cc = date('m-d', strtotime('+60 days', $date)); 
            $hol[8] = $easter; 
            $hol[9] = $easterSec; 
            $hol[10] = $cc; 
        } 
        $weekDay=date('w',$date1); 
        if (!($weekDay==0  || in_array(date('m-d',$date1),$hol))) 
            $i++; 
        
    } 
    return date('d-m-Y',$date1); 
} 
	 
}
